//
//  JSNearbyCell.m
//  NiubilityProject
//
//  Created by Apple on 2017/12/4.
//  Copyright © 2017年 Apple. All rights reserved.
//

#import "JSNearbyCell.h"
#import "JSCountryInfoModel.h"
@interface JSNearbyCell ()

@property (weak, nonatomic) IBOutlet UIButton *genderBtn;

@property (weak, nonatomic) IBOutlet UIView *markView;
@property (weak, nonatomic) IBOutlet UIImageView *contentImage;
@property (weak, nonatomic) IBOutlet UILabel *ageL;
@property (weak, nonatomic) IBOutlet UILabel *addressL;

@end

@implementation JSNearbyCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)setUser:(UserInfo *)user{
    _user = user;
    self.genderBtn.selected = user.sex == UserGenderMale?NO:YES;
    [self.contentImage setImageWithURL:[NSURL URLWithString:user.avatar] placeholder:defauldUserIcon];
    self.ageL.text = NSStringFormat(@"%@%@", user.age,JSLocalizedString(@"YearsOld"));
    if (JSLocalizeIsChina()) {
        self.addressL.text = NSStringFormat(@"%@-%@", user.city.country_zh,user.city.state_zh);
    }else{
        self.addressL.text = NSStringFormat(@"%@-%@", user.city.country,user.city.state);
    }
}

@end
